<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="java.io.PrintWriter" %>
<%@ page import="java.io.StringWriter" %>
<%@include file="/WEB-INF/views/common/tags.jspf" %>

<%
	Integer statusCode = (Integer) request.getAttribute("javax.servlet.error.status_code");
	pageContext.setAttribute("statusCode", statusCode);
	
	String uri = (String) request.getAttribute("javax.servlet.error.request_uri");
	String queryString = request.getQueryString();
	String url = uri + (queryString == null || queryString.length() == 0 ? "" : "?" + queryString);
	pageContext.setAttribute("url", url);
	
	Throwable exception = (Throwable) request.getAttribute("javax.servlet.error.exception");
	request.setAttribute("exception", exception);
%>
<c:if test="${not empty exception}">
    <%
        StringWriter stringWriter = new StringWriter();
        PrintWriter printWriter = new PrintWriter(stringWriter);
        exception.printStackTrace(printWriter);
        pageContext.setAttribute("stackTrace", stringWriter.toString());
    %>
</c:if>


<title>500 Error Page - Shine Admin</title>

<!-- ajax layout which only needs content area -->
<div class="row">
	<div class="col-xs-12">
		<!-- PAGE CONTENT BEGINS -->

		<!-- #section:pages/error -->
		<div class="error-container">
			<div class="well">
				<h1 class="grey lighter smaller">
					<span class="blue bigger-125">
						<i class="ace-icon fa fa-random"></i>
						500
					</span>
					出事了
				</h1>

				<hr />
				<h3 class="lighter smaller">
					但我们正在努力
					<i class="ace-icon fa fa-wrench icon-animated-wrench bigger-125"></i>
					...
				</h3>

				<div class="space"></div>

				<div>
					<h4 class="lighter smaller">同时，请尝试以下操作:</h4>

					<ul class="list-unstyled spaced inline bigger-110 margin-15">
						<li>
							<i class="ace-icon fa fa-hand-o-right blue"></i>
							<a href="javascript:void(0);">阅读FAQ</a>
						</li>

						<li>
							<i class="ace-icon fa fa-hand-o-right blue"></i>
							<a href="javascript:void(0);">给我们更多的信息关于此特定错误发生！</a>
						</li>

						<li>
							<i class="ace-icon fa fa-hand-o-right blue"></i>
							<a href="javascript:void(0);" class="btn-detail">详细错误信息！</a>
							<c:if test="${not empty error.message }">
								<span style='color:red;'>【${error.message}】</span>
							</c:if>
							<div class="well well-sm detail" style="display:none;">
								${stackTrace}
							</div>
						</li>
					</ul>
				</div>

				<hr />
				<div class="space"></div>
				

				<div class="center">
					<a href="javascript:history.back()" class="btn btn-grey">
						<i class="ace-icon fa fa-arrow-left"></i>
						返回
					</a>

					<a href="#${ctx}/admin/index/dashboard" class="btn btn-primary">
						<i class="ace-icon fa fa-tachometer"></i>
						中控台
					</a>
					
					<a href="javascript:window.location.reload();" class="btn btn-danger">
						<i class="ace-icon fa fa-tachometer"></i>
						刷新,看看是否能访问了
					</a>
				</div>
			</div>
		</div>

		<!-- /section:pages/error -->

		<!-- PAGE CONTENT ENDS -->
	</div><!-- /.col -->
</div><!-- /.row -->

<!-- page specific plugin scripts -->
<script type="text/javascript">
	var scripts = [null, null];
	$('.page-content-area').ace_ajax('loadScripts', scripts, function() {
		$(".btn-detail").click(function() {
	        $(".detail").toggle();
	    });
	});
</script>

